package cn.com.nes.site.service.system.user;

import cn.com.nes.mybatis.agent.system.entity.RepairUser;
import cn.com.nes.mybatis.agent.system.entity.TUser;
import cn.com.nes.site.entity.PageData;
import cn.com.nes.site.entity.em.UserTypeEnum;
import cn.com.nes.site.entity.vo.NullVO;
import cn.com.nes.site.entity.vo.system.GetAuthTokenByErUserIdVO;
import cn.com.nes.site.entity.vo.system.GetAuthTokenVO;
import cn.com.nes.site.entity.vo.system.GetOtherInstallUserVO;
import cn.com.nes.site.entity.vo.system.UpdateUserInfoFromEasyRepairVO;
import cn.com.nes.site.entity.vo.user.PushUserInfoVO;
import cn.com.nes.site.service.project.dto.MyTeamInfoDTO;
import cn.com.nes.site.service.system.user.bo.QueryInstallUsersBO;
import cn.com.nes.site.service.system.user.bo.QueryRepairUsersBO;
import cn.com.nes.site.service.system.user.bo.SaveERUserBO;
import com.baomidou.mybatisplus.extension.service.IService;

import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.Set;

public interface SystemUserService extends IService<TUser> {

    PageData batchInitUserPassword() throws Exception;


    Byte getIsAgent(String userId) throws Exception;


    TUser getUserInfoByUserId(String userId);



    TUser getUserInfoByCallCenterUserId(String callCenterUserId);


    /**
     * 异步创建长效管护、易修用户
     * @param pushUserInfoVO
     */
    void pushUserInfo(PushUserInfoVO pushUserInfoVO);


    /**
     * 根据长效管护 - 客服中心id获取热链云公司id
     * @param callCenterCompanyId
     * @return
     */
    String getCompanyId(String callCenterCompanyId) throws Exception;


    /**
     * 根据热链云公司id获取全部用户id
     * @param companyId
     * @return
     */
    List<String> getUserIdList(String companyId);


    PageData getAuthToken(GetAuthTokenVO vo) throws Exception;


    /**
     * 查询安装人员列表,下拉框不分页
     * @param vo
     * @return
     */
    Object getInstallPersonList(NullVO vo) throws Exception;


    PageData getAuthTokenByErUserId(GetAuthTokenByErUserIdVO vo) throws Exception;


    boolean hasUsers(String companyIdOrDepartmentId) throws Exception;


    void removeUserFormDepartment(String departmentId, Long operateUserId, Date operateDate);


    List<TUser> getUsers(String companyIdOrDepartmentId) throws Exception;

    public List<RepairUser> getRepairUser(String companyIdOrDepartmentId);
    List<TUser> getUsers(Long erUserId) throws Exception;


    List<TUser> getUsers(String companyId, Long erUserId) throws Exception;


    List<TUser> getUsers(List<Long> userIds) throws Exception;


    List<TUser> getUsers(String companyOrDepartmentId, UserTypeEnum userTypeEnum) throws Exception;


    List<TUser> getInstallUserSelect(String companyOrDepartmentId) throws Exception;

    List<TUser> getInstallUsers(QueryInstallUsersBO bo) throws Exception;

    List<TUser> getPcRepairUsers(QueryRepairUsersBO bo) throws Exception;

    List<RepairUser> getRepairUsers(QueryRepairUsersBO bo) throws Exception;

    List<String> getUserAreaCodes(Long erUserId) throws Exception;


    /**
     * 按部门获取其他安装用户
     */
    List<Map<String, String>> getOtherInstallUserSelectByDept(GetOtherInstallUserVO vo) throws Exception;


    /**
     * 校验本部门是否已有施工负责人
     */
    Boolean checkHaveForeman(String departmentId);


    List<Long> getUserIdList(List<String> departmentIdList, String serviceUserName, String serviceUserPhone);


    /**
     * 查询我的施工队列表
     */
    List<MyTeamInfoDTO> getMyTeamInfoList(Long easyRepairUserId);


    /**
     * 校验当前登录人是否是施工队负责人
     */
    Boolean checkIsForeman(String easyRepairUserId);


    /**
     * 查询易修用户对应的长效管护用户id
     */
    List<String> getCallCenterUserIdListByEasyRepairUserId(Long easyRepairUserId);


    TUser saveERUser(SaveERUserBO saveERUserBO) throws Exception;


    TUser getUser(String companyId, Long easyRepairUserId) throws Exception;


    /**
     * 查询易修对应的项目服务人员信息
     */
    TUser getServiceUserInfo(String projectUuidId, Long easyRepairUserId);


    /**
     * 同步易修用户账号信息
     */
    Boolean updateUserInfoFromEasyRepair(UpdateUserInfoFromEasyRepairVO vo) throws Exception;

    /**
     * 根据用户姓名模糊查询用户id集合
     */
    Set<Long> getUserIdSet(String companyId, String createUserName);

    /**
     * 根据用户id查询用户id电话号
     */
    List<String> getUserPhoneById(String maintainId) throws Exception;
}
